<script src="/login/status"></script>
<script>
    if(!isLogin) location.href = "/admin/login.html"
</script>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理后台首页</title>
    <link rel="stylesheet" href="../assets/vendors/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../assets/css/common.css">
    <link rel="stylesheet" href="../assets/css/admin.css">
    <link rel="stylesheet" href="../assets/vendors/aliFont/iconfont.css">
    <link rel="stylesheet" href="../assets/vendors/nprogress/nprogress.css">
    <script src="../assets/vendors/nprogress/nprogress.js"></script>
    <script src="../assets/vendors/Jquery/jquery-1.11.0.min.js"></script>
</head>
<body>
    <script>NProgress.start()</script>
    <div class="indexBox clearfix">
        <div class="slide">
            <div class="slide-head">
                <div class="avatar">
                    <img src="../uploads/avatar.jpg" alt="">
                </div>
                <span class="user">Coder</span>
            </div>
            <div class="nav">
                <ul class="navItems">
                    <li class="navActive">
                        <a href="./index.html">
                             <span class=" iconfont icon-yibiaopan"></span>仪表盘
                        </a>
                    </li>
                    <li>
                        <div class="nav-item">
                            <a><span class=" iconfont icon-wenzhang"></span>文章<span class=" iconfont icon-arrow-right arrow"></span></a>
                        </div>
                        <ul class="itemgroup">
                            <li><a href="articleAll.html">所有文章</a></li>
                            <li><a href="addArticle.html">写文章</a></li>
                            <li><a href="cateArticle.html">分类目录</a></li>
                        </ul>
                    </li>
                    <li><a href="./comments.html"><span class=" iconfont icon-chat"></span>评论</a></li>
                    <li><a href="./user.html"><span class=" iconfont icon-yonghu"></span>用户</a></li>
                    <li>
                        <div class="nav-item">
                           <a> <span class=" iconfont icon-shezhi"></span>设置<span class="iconfont icon-arrow-right arrow"></span></a>
                        </div>
                        <ul class="itemgroup" >
                            <li><a href="slides.html">图片轮播</a></li>
                            <li><a href="settings.html">网站设置</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <div class="main">
            <div class="content-head">
                <div class="content-icon">
                    <div class="content-left">
                        <span class="iconfont icon-shouqianniuicon"></span>
                    </div>
                </div>
                <div class="modify">
                    <a href="passwordReset.html">
                      <span class="iconfont icon-yonghu1"></span>修改密码
                    </a>
                </div>
                <div class="loginOut">
                    <span class="iconfont icon-tuichu_huaban1"></span><span>退出</span>
                </div>
            </div>
            <div class="content">
               <p>所有文章
                <a href="addArticle.html" class="btn btn-primary btn-xs active">写文章</a>
               </p>
              <div class="pageContent clearfix">
                <div class="fl selectItem">
                    <select name="" id="allCatePost">
                        
                    </select>
                    <select name="" id="postState">
                         <option value="0">草稿</option>
                         <option value="1">已发布</option>
                     </select>
                     <span class="filterCate">筛选</span>
                </div>
                <div class="fr pageChange">
                    <ul class="pagination">
                        
                      </ul>
                </div>
              </div>
              <table border class="artTable">
                  <thead>
                      <tr>
                        <th width="30%">标题</th>
                        <th width="15%">作者</th>
                        <th width="15%">分类</th>
                        <th width="20%">发表时间</th>
                        <th width="10%">状态</th>
                        <th width="10%">操作</th>
                      </tr>
                  </thead>
                  <tbody>
                  </tbody>
              </table>
            </div>
        </div>
    </div>
    <script>NProgress.done()</script>
    <script src="../assets/js/common.js"></script>
    <script src="../assets/vendors/art-template/template-web.js"></script>
    <script type='text/html'id="catePostTpl">
        
        {{each data}}
        <option value="{{$value._id}}">{{$value.title}}</option>
        {{/each}}
    </script>
    <script type='text/html' id="pageChangeTpl">
        {{if page > 1}}
        <li><span aria-hidden="true" onclick="changePage({{page-1}})">上一页</span></li>
        {{/if}}
        {{each display}}
        <li><a href="#" onclick="changePage({{$value}}, event)">{{$value}}</a></li>
        {{/each}}
        {{if page < pages}}
        <li><span aria-hidden="true" onclick="changePage({{page +1}})">下一页</span></li>
        {{/if}}
    </script>
    <script type='text/html' id="showPostTpl">
        {{each data}}
        <tr>
            <td>{{$value.title}}</td>
            <td>{{$value.author.nickName}}</td>
            <td>{{$value.category.title}}</td>
            <td>{{$value.updateAt.split('T')[0]}}</td>
            <td>{{$value.state == '0'? '草稿': '已发布'}}</td>
            <td>
                <a href="addArticle.html?id={{$value._id}}" class="btn btn-default btn-xs">编辑</button>
                <a href="#" class="btn btn-danger btn-xs deletePost" data-id="{{$value._id}}">删除</button>
            </td>
           </tr>
        {{/each}}
    </script>
    <script src="../assets/js/postAll.js"></script>
    
</body>
</html>